<%@ page language="java" import="java.util.*,java.sql.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<jsp:useBean id="db" class="connBean.ConnDB" scope="page">
</jsp:useBean>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title></title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #EEF2FB;
}
-->
</style>
  </head>
  
  <body>
    <% 
    int deleteid=Integer.parseInt(request.getParameter("deleteid"));
    
    String sql="delete from notice where n_id="+deleteid+"";//定义插入SQL语句
    
db.OpenConn();
db.createStmt();
int result=db.Update(sql);

 if(result==1){ 
 response.sendRedirect("selectnotice.jsp");//执行插入成功跳转
 }else{
 %>
删除失败，等待5秒后返回。
 <%
 response.setHeader("Refresh","5;URL=selectnotice.jsp");//执行插入失败跳转
 }
 db.closeStmt();
 db.closeConn();
    %>
  </body>
</html>
